from market.models import GoodsImg


def setGoodsImage(user, path, goods):
    imgs = GoodsImg.objects.filter(owner=user, relative_path=path);
    if len(imgs) != 1: return False
    img = imgs[0]

    img.goods = goods 
    img.save()
    return True

